# -*- coding: utf-8 -*-

from django import forms
from tinymce import widgets
from django.contrib.auth.models import Group

WIKI_MCE_ATTRS = {
        "plugins": "-wikiplugin",
        "relative_urls": False, 
        "spellchecker_languages": "+polski=pl", 
        "elements": "id_tresc", 
        "language": "pl", 
        "directionality": "ltr", 
        "theme": "advanced",
        "theme_advanced_buttons1" : "linkidostron,bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,bullist,numlist,undo,redo,link,unlink",
        "theme_advanced_buttons2" : "",
        "theme_advanced_buttons3" : "",
        "strict_loading_mode": 1, 
        "mode": "exact"
}

class StronaForm(forms.Form):
    tresc = forms.CharField(widget=widgets.TinyMCE(mce_attrs=WIKI_MCE_ATTRS), label=u'Treść', )
    komentarz = forms.CharField(label=u'Komentarz', help_text=u'Napisz co zmieniłeś by innym było łatwiej odszukać różnice pomiędzy wersjami')
    grupy = forms.ModelMultipleChoiceField(queryset=Group.objects.all(), required=False)

